package com.aaa.controller;

import com.aaa.entity.Function;
import com.aaa.service.FunctionService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RequestMapping("function")
@RestController
public class FunctuibController {

    @Resource
    private FunctionService functionService;

    @RequestMapping("query")
    public List<Function> query(){
        return functionService.query();
    }

    @RequestMapping("findlist")
    public Object findlist(String sname){
        return functionService.findlist(sname);
    }

    /*@RequestMapping("findAllById")
    public String findAllById(Integer id){
        System.out.println(functionService.findAllById(id));
        return functionService.findAllById(id);
    }*/

    @RequestMapping("findAll")
    public Object findAll(){
        return functionService.findAll();
    }

    @RequestMapping("findbyidto")
    public Object findbyidto(Integer id){
        /*List<Map> list= (List<Map>) functionService.findbyidto(id);
        String[] aaa = new String[list.size()];
        for (Integer i=0;i<list.size();i++) {
            aaa[i]=list.get(i).get("id").toString();
            
        }*/
        return functionService.findbyidto(id);
    }




}
